import { TextArea as ATextArea } from 'antd-mobile'
import '../index.less'
import type { TextAreaPropsType } from '@/form'

type PropsType = TextAreaPropsType

const Textarea = (props: PropsType) => {

  const {
    label = '',
    name = '',
    value = '',
    placeholder = '',
    rows = 3,
    autoSize = false,
    maxLength = 50,
    showCount = true,
    className = '',
    ...ohterProps
  } = props

  return <ATextArea
    className={'c-form-textarea' + (className ? ' ' + className : '')}
    name={name}
    placeholder={placeholder ? placeholder : '请输入' + label}
    rows={rows}
    autoSize={autoSize}
    maxLength={maxLength}
    showCount={showCount}
    {...ohterProps}
  />
}

export default Textarea
